<?php
namespace Home\Controller;
use Think\Controller;

class AssociationController extends CommonController {

    public function index(){
		$this->res=M('department')->find(10);
		$this->display();
    }

    public function handle(){
    	$url = uploadImage();
        $db=M('department');
        $user=$db->find(10);
        $dat=array(
            'image_url'=>$url
            );
        $data=array(
            'id'=>10,
            'function'=>$_POST['function'],
            );
        if($url!=-1)
            $data = array_merge($data, $dat);
        if(M('department')->data($data)->save()){
    		$this->success('修改成功');
    	}
    }
}
?>